Optimal. Leaf size=71 \[ \frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{\log (\sin (c+d x))}{a^2 d}-\frac{3 i x}{4 a^2}+\frac{1}{4 d (a+i a \tan (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.140743, antiderivative size = 71, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3559, 3596, 3531, 3475} \[ \frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{\log (\sin (c+d x))}{a^2 d}-\frac{3 i x}{4 a^2}+\frac{1}{4 d (a+i a \tan (c+d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3559
Rule 3596
Rule 3531
Rule 3475
Rubi steps
\begin{align*} \int \frac{\cot (c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=\frac{1}{4 d (a+i a \tan (c+d x))^2}+\frac{\int \frac{\cot (c+d x) (4 a-2 i a \tan (c+d x))}{a+i a \tan (c+d x)} \, dx}{4 a^2}\\ &=\frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{1}{4 d (a+i a \tan (c+d x))^2}+\frac{\int \cot (c+d x) \left (8 a^2-6 i a^2 \tan (c+d x)\right ) \, dx}{8 a^4}\\ &=-\frac{3 i x}{4 a^2}+\frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{1}{4 d (a+i a \tan (c+d x))^2}+\frac{\int \cot (c+d x) \, dx}{a^2}\\ &=-\frac{3 i x}{4 a^2}+\frac{\log (\sin (c+d x))}{a^2 d}+\frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{1}{4 d (a+i a \tan (c+d x))^2}\\ \end{align*}
Mathematica [A] time = 0.323348, size = 135, normalized size = 1.9 \[ \frac{\sec ^2(c+d x) \left (4 d x \sin (2 (c+d x))+i \sin (2 (c+d x))-8 i \sin (2 (c+d x)) \log \left (\sin ^2(c+d x)\right )+\cos (2 (c+d x)) \left (-8 \log \left (\sin ^2(c+d x)\right )-4 i d x-1\right )+16 i \tan ^{-1}(\tan (d x)) (\cos (2 (c+d x))+i \sin (2 (c+d x)))-8\right )}{16 a^2 d (\tan (c+d x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.079, size = 91, normalized size = 1.3 \begin{align*}{\frac{-{\frac{3\,i}{4}}}{{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{1}{4\,{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{7\,\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{8\,{a}^{2}d}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{8\,{a}^{2}d}}+{\frac{\ln \left ( \tan \left ( dx+c \right ) \right ) }{{a}^{2}d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.20427, size = 201, normalized size = 2.83 \begin{align*} \frac{{\left (-28 i \, d x e^{\left (4 i \, d x + 4 i \, c\right )} + 16 \, e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) + 8 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{16 \, a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.18548, size = 150, normalized size = 2.11 \begin{align*} \begin{cases} \frac{\left (16 a^{2} d e^{4 i c} e^{- 2 i d x} + 2 a^{2} d e^{2 i c} e^{- 4 i d x}\right ) e^{- 6 i c}}{32 a^{4} d^{2}} & \text{for}\: 32 a^{4} d^{2} e^{6 i c} \neq 0 \\x \left (- \frac{\left (7 i e^{4 i c} + 4 i e^{2 i c} + i\right ) e^{- 4 i c}}{4 a^{2}} + \frac{7 i}{4 a^{2}}\right ) & \text{otherwise} \end{cases} - \frac{7 i x}{4 a^{2}} + \frac{\log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.24016, size = 111, normalized size = 1.56 \begin{align*} -\frac{\frac{2 \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{2}} + \frac{14 \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} - \frac{16 \, \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{2}} - \frac{21 \, \tan \left (d x + c\right )^{2} - 54 i \, \tan \left (d x + c\right ) - 37}{a^{2}{\left (\tan \left (d x + c\right ) - i\right )}^{2}}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]